package at.fhooe.im440.clock;

import java.util.ArrayList;
import java.util.List;

import at.fhooe.im440.core.Core;


public class Clock {

	private List<Timer> timers;
	private Core c;
	private long millis;
	
	public Clock(Core c){
		this.millis = System.currentTimeMillis();
		this.c = c;
	}
	
	public void updateTimers(){
		for(Timer t: timers){
			t.tick();
		}
	}
	
	public void addTimer(Timer t){
		if(timers == null ){
			timers = new ArrayList<Timer>();
		}
		timers.add(t);
	}
	
	public void update(){
		try {
			Thread.sleep(1000);	
			updateTimers();
		} catch(InterruptedException ex){
		
		}
	}
}
